<?php

use Biz\service\springHomeDecActivity\WishService;

class UserWishAction extends ActionPlugin
{
    const USER_LEVEL = self::LEVEL_NOTHING;

    public function main()
    {
        $wishUid = $this->getPost('wish_uid', 0);
        if (!$wishUid) {
            $wishUid = $this->uid;
            if (!$wishUid) {
                throw new \Exception("参数错误", self::CODE_ERROR_VIEW_TOSTA);
            }
        }
        $userWish = [];
        $wishInfo = WishService::userWish($wishUid);
        if ($wishInfo && is_array($wishInfo)) {
            $userWish = $wishInfo;
        }
        $this->setSuccess($userWish);
    }
}